package xyz.poke.business.tool.common;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 迫壳
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PageResult<T extends Serializable> implements Serializable {

    public static final long serialVersionUID = 42L;

    private List<T> records = new ArrayList<>();

    private Long total = 0L;

    private Long pages = 1L;

    public Boolean isEmpty() {
        return CollectionUtils.isEmpty(records);
    }

}